cmake_minimum_required(VERSION 3.16)
project(QAxios LANGUAGES CXX)

include(qt.cmake)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Library)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Library)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Runtime)

include_directories(${SOLUTION_DIR}/Softwarer/CProimse)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR}
    COMPONENTS
        Core
)
find_package(Qt6 REQUIRED COMPONENTS Network)

qt_standard_project_setup()

set(PROJECT_HEADERS
    qaxios_global.h
    Param.h
    QAxios.h
    ResultResponse.h
)

set(PROJECT_SOURCES    
    Param.cpp
    QAxios.cpp
    ResultResponse.cpp
)

add_library(${PROJECT_NAME} SHARED ${PROJECT_HEADERS} ${PROJECT_SOURCES})

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        Qt::Core
)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Network)

target_compile_definitions(${PROJECT_NAME}
    PRIVATE
        QAXIOS_LIB
)

